home *** CD-ROM | disk | FTP | other *** search
/ Mac Easy 2010 May / Mac Life Ubuntu.iso / casper / filesystem.squashfs / usr / lib / ubiquity / target-config / 40install_driver_updates < prev   
Encoding:
Text File  |  2009-04-18  |  602 b   |  25 lines

  1. #! /bin/sh
  2. set -e
  3.  
  4. if [ ! -d /var/cache/driver-updates ]; then
  5.     exit 0
  6. fi
  7.  
  8. install_dir=/var/cache/driver-updates
  9.  
  10. trap "rm -rf /target$install_dir" EXIT HUP INT QUIT TERM
  11. mkdir -p "/target$install_dir"
  12. cp -a /var/cache/driver-updates/*.deb "/target$install_dir/" || exit 0
  13.  
  14. # We cannot leave packages in a bad state. So if the install fails, remove
  15. # it. This will get caught in /var/log/syslog.
  16. for deb in "/target$install_dir"/*; do
  17.     [ -f "$deb" ] || continue
  18.     debbase="${deb##*/}"
  19.     if ! chroot /target dpkg -i "$install_dir/$debbase"; then
  20.         chroot /target dpkg -P "${debbase%%_*}"
  21.     fi
  22. done
  23.  
  24. exit 0
  25.